from pydantic import BaseModel, Field
from typing import Optional

from decimal import Decimal
from datetime import datetime


class CustomerInfoBase(BaseModel):
    customer_code: Optional[str] = Field(None, description="客户编码")
    customer_name: str = Field(..., description="客户名称")
    business_type: Optional[str] = Field(None, description="商机类别")
    division: Optional[str] = Field(None, description="事业部")
    category: Optional[str] = Field(None, description="类别")
    industry_type: Optional[str] = Field(None, description="行业别")
    strategy_industry: Optional[str] = Field(None, description="策略行业")
    customer_source: Optional[str] = Field(None, description="客户来源")
    salesperson: Optional[str] = Field(None, description="业务员")
    customer_product: Optional[str] = Field(None, description="客户产品")
    informatization_status: Optional[str] = Field(None, description="客户信息化现状")
    scale: Optional[str] = Field(None, description="营业规模")
    acpid: Optional[str] = Field(None, description="ACPID")
    address: Optional[str] = Field(None, description="地址")
    employee_count: Optional[int] = Field(None, description="员工人数")
    company_nature: Optional[str] = Field(None, description="企业性质")
    capital: Optional[Decimal] = Field(None, description="资本额")
    website: Optional[str] = Field(None, description="公司网址")
    created_by: Optional[str] = Field(None, description="创建人")
    create_time: Optional[datetime] = Field(None, description="创建时间")
    updated_by: Optional[str] = Field(None, description="更新人")
    update_time: Optional[datetime] = Field(None, description="更新时间")


class CustomerInfoCreate(CustomerInfoBase):
    pass


class CustomerInfoUpdate(BaseModel):
    customer_code: Optional[str] = Field(None, description="客户编码")
    customer_name: Optional[str] = Field(None, description="客户名称")
    business_type: Optional[str] = Field(None, description="商机类别")
    division: Optional[str] = Field(None, description="事业部")
    category: Optional[str] = Field(None, description="类别")
    industry_type: Optional[str] = Field(None, description="行业别")
    strategy_industry: Optional[str] = Field(None, description="策略行业")
    customer_source: Optional[str] = Field(None, description="客户来源")
    salesperson: Optional[str] = Field(None, description="业务员")
    customer_product: Optional[str] = Field(None, description="客户产品")
    informatization_status: Optional[str] = Field(None, description="客户信息化现状")
    scale: Optional[str] = Field(None, description="营业规模")
    acpid: Optional[str] = Field(None, description="ACPID")
    address: Optional[str] = Field(None, description="地址")
    employee_count: Optional[int] = Field(None, description="员工人数")
    company_nature: Optional[str] = Field(None, description="企业性质")
    capital: Optional[Decimal] = Field(None, description="资本额")
    website: Optional[str] = Field(None, description="公司网址")
    created_by: Optional[str] = Field(None, description="创建人")
    create_time: Optional[datetime] = Field(None, description="创建时间")
    updated_by: Optional[str] = Field(None, description="更新人")
    update_time: Optional[datetime] = Field(None, description="更新时间")
